home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Extra 1997 #1
/
Amiga Plus Extra 1997 #1.iso
/
programme
/
tools
/
wincloser
/
iesupport.a
next >
Wrap
Text File
|
1996-11-25
|
2KB
|
62 lines
*
* Required includes...
*
INCLUDE "exec/types.i"
INCLUDE "exec/io.i"
INCLUDE "devices/inputevent.i"
*
************************************************************************
*
* Make the entry point external...
*
xdef _AlternateCloseWin
*
************************************************************************
*
* The event list gets passed to you in a0.
* The is_Data field is passed to you in a1.
* This example does not use the is_Data field...
*
* On exit you must return the event list in d0. In this way
* you could add or remove items from the event list.
*
************************************************************************
*
* The handler gets called here...
*
SECTION _AlternateCloseWin,CODE
_AlternateCloseWin:
move.l a0,-(sp) ; Save the event list
moveq #$0d,d1 ; RAWKEY for "\"
*
* Since the event list could be a linked list, we start a loop
* here to handle all of the events passed to us.
*
CheckLoop: cmp.b #IECLASS_RAWKEY,ie_Class(a0) ; Get Class...
bne.s NextEvent
cmp.w ie_Code(a0),d1 ; RAWKEY for "\"
bne.s NextEvent
move.w ie_Qualifier(a0),d0 ; Get qualifiers...
btst #IEQUALIFIERB_CONTROL,d0
beq.s NextEvent
bchg #IEQUALIFIERB_CONTROL,d0
move.w d0,ie_Qualifier(a0)
move.b #IECLASS_CLOSEWINDOW,ie_Class(a0)
clr.w ie_Code(a0)
NextEvent: move.l (a0),d0 ; Get next event
move.l d0,a0 ; into a0...
bne.s CheckLoop ; Do some more.
*
* All done, just return the event list... (in d0)
*
move.l (sp)+,d0 ; Get event list back...
rts ; return from handler...
END